using TripleA.Core.Interfaces;
using TripleA.Core.Interfaces.Entities;

namespace TripleA.IIS.Extensions.IIS7
{
    public static class Iis7Extensions
    {
        public static IPipelineConfig<T> AppPoolExists<T>(this IPipelineConfig<T> config, string machineName, string appPoolName)
            where T : Context
        {
            config.RunStep(new Iis7AppPoolExistsStep<T>
                               {
                                   MachineName = machineName,
                                   AppPoolName = appPoolName
                               });
            return config;
        }

        public static IPipelineConfig<T> AppPoolRecycle<T>(this IPipelineConfig<T> config, string machineName, string appPoolName)
            where T : Context
        {
            config.RunStep(new Iis7AppPoolRecycleStep<T>
                               {
                                   MachineName = machineName,
                                   AppPoolName = appPoolName
                               });
            return config;
        }
    }
}